﻿
@{
    ViewBag.Title = "MemberEdit";
    Layout = "~/Views/Shared/_LayoutMember.cshtml";
    var user = Session["LoginUser"] as Domain.Model.User;
}
@model Domain.Model.Pay


@section Script
{
    <script src="~/Content/calendar/WdatePicker.js"></script>

    <link href="~/Content/mvcpage/jquery.mvcpage.css" rel="stylesheet" />
    <script src="~/Content/mvcpage/jquery.mvcpage.js"></script>

    <script type="text/javascript">
        $(function () {
            $(".pagectrl").mvcPage({
                url: '/member/ElectronicTokenPage',
                callBack: function (html) {
                    $(".list").html(html);
                }
            });
           
        });

        function search() {
            $(".pagectrl").mvcPage('option').queryParam.keyword = $('#keyword').val();
            $(".pagectrl").mvcPage('reload');
        }
    </script>
}

<div class="fr2 green fs-25 Tbrline">在线充值电子币</div>
<div class="fr2">

    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:void(0);">汇款登记</a></li>
        <li><a href="javascript:void(0);">汇款记录</a></li>
    </ul>


    <form class="form-horizontal">
        <div class="tab_box">
            <div>
                <div class="control-group">
                    <label class="control-label" for="inputEmail">会员编号/昵称</label>
                    <div class="controls">
                        @Html.TextBoxReadonlyFor(i=>i.MemberNo)
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="inputPassword">账号</label>
                    <div class="controls">
                        @Html.RadioButtonFor(i=>i.PayBankName,Model.PayBankName)@Model.PayBankName
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="inputPassword">汇款人姓名</label>
                    <div class="controls">
                        @Html.TextBoxFor(i => i.PayUserName,Html.ValidFor(i=>i.PayUserName))
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="inputEmail">汇款人账号后6位数</label>
                    <div class="controls">
                        @Html.TextBoxFor(i => i.PayNum,Html.ValidFor(i=>i.PayUserName))
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="inputEmail">金额</label>
                    <div class="controls">
                        @Html.TextBoxFor(i => i.RMB,Html.ValidFor(i=>i.RMB))
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="inputEmail">实际金额</label>
                    <div class="controls">
                        @Html.TextBoxFor(i => i.Euro,Html.ValidFor(i=>i.Euro))
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="inputEmail">日期</label>
                    <div class="controls">
                      <input class="Wdate" type="text" id="d15" onFocus="WdatePicker({isShowClear:false,readOnly:true})" value="@Model.CreateTime.ToString("yyyy-MM-dd")"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="inputEmail">说明</label>
                    <div class="controls">
                        @Html.TextAreaFor(i => i.Remark,Html.ValidFor(i=>i.Remark))
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="inputEmail">交易密码</label>
                    <div class="controls">
                        @Html.Password("ExchangePassword")
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label"></label>
                    <div class="controls">
                        <input type="button" value="提    交" class="sbtn" onclick="saveForm()" />
                    </div>
                    
                </div>
                    <div class="alert">
                        <ol>
                            <li>说明：</li>
                            <li>1) 本公司不承担汇入款项的汇款手续费，充值金额以本公司实际收到的款项为准。</li>
                            <li>2) 请您逐笔做汇款登记，不可将两笔或两笔以上的汇款合并登记。</li>
                            <li>3) 您在登记汇款金额时精确到分位，不可四舍五入。</li>
                        </ol>
                    </div>

                <img  src="~/images/Remittance.jpg"/>
            </div>

            <div class="hide" class="div2">


                <table class="table table-bordered">
                    <caption>
                    </caption>
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>银行名称</th>
                            <th>汇款人姓名</th>
                            <th>汇款人账号后6位数</th>
                            <th>汇入人民币</th>
                            <th>实际金额</th>
                            <th>说明</th>
                            <th>日期</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody class="list">
                    </tbody>

                </table>
                <div class="text-right pagectrl"></div>
            </div>
        </div>
    </form>

</div>

<script type="text/javascript">
    var $div_li = $(".fr2 ul li");
    $div_li.click(function () {

        $(this).addClass("active").siblings().removeClass("active");

        var index = $div_li.index(this);

        $("div.tab_box>div")
            .eq(index).show()
           .siblings().hide();

    });



    //保存
    function saveForm() {
        $("form").validBox(function (r) {
            if (!r)
                return;
            $.post("/member/SaveElectronicToken", $("form").serialize(), function (data) {
                if (data.state) {
                    window.messageBox("提示", "汇款登记成功!");

                    $('#ExchangePassword').val("");
                    $(".active").removeClass("active").siblings().addClass("active");
                    var index = $div_li.index(this);
                    $("div.tab_box>div")
                        .eq(index).show()
                       .siblings().hide();

                    $(".pagectrl").mvcPage('reload');
                }
                else {
                    window.messageBox("提示", data.value);
                }
            });
        });
    };
</script>







